﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace NotificationRegistrationService
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://notificationtest.linkdev.com/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class NotificationsService : System.Web.Services.WebService
    {

        /// <summary>
        /// Adds the notification ID
        /// </summary>
        /// <param name="nid">The notification id.</param>
        /// <param name="sid">The service id.</param>
        [WebMethod]
        public void addnid(string nid, string sid)
        {
            System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(Server.MapPath("NotificationRegistrations.txt"));

            // Do something more useful with them, like store them in a database after you check they don't exist
            streamWriter.WriteLine("**********************************");
            streamWriter.WriteLine(DateTime.Now.ToString());
            streamWriter.WriteLine("Notification id: " + nid);
            streamWriter.WriteLine("Service id: " + sid);
            streamWriter.WriteLine("**********************************");

            streamWriter.Close();
        }
    }
}